package com.mk.domain;

import act.db.DB;
import com.alibaba.fastjson.JSONObject;
import com.github.d925529.apidoc.annotation.ApiField;
import org.beetl.sql.core.annotatoin.AssignID;
import org.beetl.sql.core.annotatoin.Param;
import org.beetl.sql.core.annotatoin.Table;
import org.beetl.sql.core.mapper.BaseMapper;

import javax.persistence.Transient;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.List;
import java.util.Map;

/**
 * 说明：订单明细表
 * 作者：292303959@qq.com
 * 日期：2018-10-17 10:5:47
 * 版本：1.0.0
 */
@Table(name = "t_order_detail")
@SuppressWarnings("unused")
public class TOrderDetail implements Serializable {
    @AssignID
    //明细ID
    @ApiField("明细ID")
    private String odid;
    
    //订单ID
    @ApiField("订单ID")
    private String orderid;
    
    //订单状态 0-待付款1-待发货(已付款)2-待收货3-已收货4-已完成 
    @ApiField("订单状态 0-待付款1-待发货(已付款)2-待收货3-已收货4-已完成5-已取消")
    private String odstatus;
    
    //会员ID
    @ApiField("会员ID")
    private String mid;
    
    //规格ID
    @ApiField("规格ID")
    private String psid;
    
    //订单数量
    @ApiField("订单数量")
    private Integer detailrnumber;
    
    //订单金额
    @ApiField("订单金额")
    private java.math.BigDecimal detailtotal;
    
    //价格
    @ApiField("价格")
    private java.math.BigDecimal psprice;
    
    //售后数量
    @ApiField("售后数量")
    private Integer aftersalenum;
    
    //上级ID
    @ApiField("上级ID")
    private String pmid;
    
    //首单分佣比例
    @ApiField("首单分佣比例")
    private java.math.BigDecimal fscale;
    
    //首单分佣金额
    @ApiField("首单分佣金额")
    private java.math.BigDecimal famount;
    
    //复购分佣比例
    @ApiField("复购分佣比例")
    private java.math.BigDecimal rscale;
    
    //复购分佣金额
    @ApiField("复购分佣金额")
    private java.math.BigDecimal ramount;
    
    //结算标志(0-未结算1-已结算)
    @ApiField("结算标志(0-未结算1-已结算)")
    private String rfflag;
    
    //结算ID
    @ApiField("结算ID")
    private String rfid;

    //结算ID
    @ApiField("系列ID")
    private String brid;
    //结算ID
    @ApiField("商品ID")
    private String pdid;

    @ApiField("折扣")
    private BigDecimal discount;
    @ApiField("原价")
    private BigDecimal originalprice;
    @ApiField("会员是否已支付(0-否1-是)")
    private String rfpayflag;
    @ApiField("会长结算标志(0-未结算1-已结算)")
    private String preflag;
    @ApiField("会长结算ID")
    private String prerfid;
    @ApiField("会长是否已支付(0-否1-是)")
    private String prepayflag;
    @ApiField("完成时间")
    private String finishdate;
    @ApiField("售后前售后数量")
    private Integer preaftersalenum;

    public Integer getPreaftersalenum() {
        return preaftersalenum;
    }

    public void setPreaftersalenum(Integer preaftersalenum) {
        this.preaftersalenum = preaftersalenum;
    }

    public String getFinishdate() {
        return finishdate;
    }

    public void setFinishdate(String finishdate) {
        this.finishdate = finishdate;
    }

    public BigDecimal getDiscount() {
        return discount;
    }

    public void setDiscount(BigDecimal discount) {
        this.discount = discount;
    }

    public BigDecimal getOriginalprice() {
        return originalprice;
    }

    public void setOriginalprice(BigDecimal originalprice) {
        this.originalprice = originalprice;
    }

    public String getBrid() {
        return brid;
    }

    public void setBrid(String brid) {
        this.brid = brid;
    }

    public String getPdid() {
        return pdid;
    }

    public void setPdid(String pdid) {
        this.pdid = pdid;
    }

    public String getRfpayflag() {
        return rfpayflag;
    }

    public void setRfpayflag(String rfpayflag) {
        this.rfpayflag = rfpayflag;
    }

    public String getPreflag() {
        return preflag;
    }

    public void setPreflag(String preflag) {
        this.preflag = preflag;
    }

    public String getPrerfid() {
        return prerfid;
    }

    public void setPrerfid(String prerfid) {
        this.prerfid = prerfid;
    }

    public String getPrepayflag() {
        return prepayflag;
    }

    public void setPrepayflag(String prepayflag) {
        this.prepayflag = prepayflag;
    }

    /**
     * @return 明细ID
     */
    public String getOdid(){
        return odid;
    }
    /**
     * @param odid 明细ID
     */
    public void setOdid(String odid){
        this.odid = odid;
    }
    
    /**
     * @return 订单ID
     */
    public String getOrderid(){
        return orderid;
    }
    /**
     * @param orderid 订单ID
     */
    public void setOrderid(String orderid){
        this.orderid = orderid;
    }
    
    /**
     * @return 订单状态 0-待付款1-待发货(已付款)2-待收货3-已收货4-已完成 
     */
    public String getOdstatus(){
        return odstatus;
    }
    /**
     * @param odstatus 订单状态 0-待付款1-待发货(已付款)2-待收货3-已收货4-已完成 
     */
    public void setOdstatus(String odstatus){
        this.odstatus = odstatus;
    }
    
    /**
     * @return 会员ID
     */
    public String getMid(){
        return mid;
    }
    /**
     * @param mid 会员ID
     */
    public void setMid(String mid){
        this.mid = mid;
    }
    
    /**
     * @return 规格ID
     */
    public String getPsid() {
        return psid;
    }

    public void setPsid(String psid) {
        this.psid = psid;
    }

    /**
     * @return 订单数量
     */
    public Integer getDetailrnumber(){
        return detailrnumber;
    }
    /**
     * @param detailrnumber 订单数量
     */
    public void setDetailrnumber(Integer detailrnumber){
        this.detailrnumber = detailrnumber;
    }
    
    /**
     * @return 订单金额
     */
    public java.math.BigDecimal getDetailtotal(){
        return detailtotal;
    }
    /**
     * @param detailtotal 订单金额
     */
    public void setDetailtotal(java.math.BigDecimal detailtotal){
        this.detailtotal = detailtotal;
    }
    
    /**
     * @return 价格
     */
    public java.math.BigDecimal getPsprice(){
        return psprice;
    }
    /**
     * @param psprice 价格
     */
    public void setPsprice(java.math.BigDecimal psprice){
        this.psprice = psprice;
    }
    
    /**
     * @return 售后数量
     */
    public Integer getAftersalenum(){
        return aftersalenum;
    }
    /**
     * @param aftersalenum 售后数量
     */
    public void setAftersalenum(Integer aftersalenum){
        this.aftersalenum = aftersalenum;
    }
    
    /**
     * @return 上级ID
     */
    public String getPmid(){
        return pmid;
    }
    /**
     * @param pmid 上级ID
     */
    public void setPmid(String pmid){
        this.pmid = pmid;
    }
    
    /**
     * @return 首单分佣比例
     */
    public java.math.BigDecimal getFscale(){
        return fscale;
    }
    /**
     * @param fscale 首单分佣比例
     */
    public void setFscale(java.math.BigDecimal fscale){
        this.fscale = fscale;
    }
    
    /**
     * @return 首单分佣金额
     */
    public java.math.BigDecimal getFamount(){
        return famount;
    }
    /**
     * @param famount 首单分佣金额
     */
    public void setFamount(java.math.BigDecimal famount){
        this.famount = famount;
    }
    
    /**
     * @return 复购分佣比例
     */
    public java.math.BigDecimal getRscale(){
        return rscale;
    }
    /**
     * @param rscale 复购分佣比例
     */
    public void setRscale(java.math.BigDecimal rscale){
        this.rscale = rscale;
    }
    
    /**
     * @return 复购分佣金额
     */
    public java.math.BigDecimal getRamount(){
        return ramount;
    }
    /**
     * @param ramount 复购分佣金额
     */
    public void setRamount(java.math.BigDecimal ramount){
        this.ramount = ramount;
    }
    
    /**
     * @return 结算标志(0-未结算1-已结算)
     */
    public String getRfflag(){
        return rfflag;
    }
    /**
     * @param rfflag 结算标志(0-未结算1-已结算)
     */
    public void setRfflag(String rfflag){
        this.rfflag = rfflag;
    }
    
    /**
     * @return 结算ID
     */
    public String getRfid(){
        return rfid;
    }
    /**
     * @param rfid 结算ID
     */
    public void setRfid(String rfid){
        this.rfid = rfid;
    }
    


    public interface Mapper extends BaseMapper<TOrderDetail> {
        /**
         * 查询订单的详情列表
         * @param orderid
         * @return
         */
        List<Map<String,Object>> detailList(@Param("orderid") String orderid);

        /**
         * 修改订单明细售后数量和奖励金额
         * @param odid
         * @param afternum
         * @return
         */
        int updateAfterSalenum(@Param("odid")String odid,@Param("afternum")int afternum);


        /**
         * 更新详情的订单完成时间
         * @param orderid
         * @param time
         * @return
         */
        Integer updateFinishdateByOrderid(@Param("orderid") String orderid, @Param("time") String time);


    }
}